// 健康报告mock数据
const generateMockData = (period = 'daily') => {
  // 基础配置
  const baseConfig = {
    healthMetricsConfig: {
      heartRate: {
        title: '心率',
        subtitle: '每分钟心跳次数',
        unit: 'bpm',
        icon: 'fa fa-heartbeat',
        iconClass: 'heart-rate',
        color: '#165DFF',
        normalRange: '60-100'
      },
      ecg: {
        title: '心电',
        subtitle: '心电图监测',
        unit: 'mV',
        icon: 'fa fa-heart',
        iconClass: 'ecg',
        color: '#FF6B6B',
        normalRange: '0.05-0.25'
      },
      bloodPressure: {
        title: '血压',
        subtitle: '收缩压/舒张压',
        unit: 'mmHg',
        icon: 'fa fa-tint',
        iconClass: 'blood-pressure',
        color: ['#F87272', '#FB923C'],
        normalRange: '收缩压<130，舒张压<80'
      },
      bloodSugar: {
        title: '血糖',
        subtitle: '空腹测量值',
        unit: 'mmol/L',
        icon: 'fa fa-flask',
        iconClass: 'blood-sugar',
        color: '#36D399',
        normalRange: '3.9-6.1'
      },
      oxygenLevel: {
        title: '血氧',
        subtitle: '血液氧饱和度',
        unit: '%',
        icon: 'fa fa-moon-o',
        iconClass: 'oxygen-level',
        color: '#36D399',
        normalRange: '95-100'
      },
      sleep: {
        title: '睡眠',
        subtitle: '睡眠时长与质量',
        unit: '小时',
        icon: 'fa fa-bed',
        iconClass: 'sleep',
        color: '#FB923C',
        normalRange: '7-8'
      },
      steps: {
        title: '步数',
        subtitle: '每日行走步数',
        unit: '步',
        icon: 'fa fa-male',
        iconClass: 'steps',
        color: '#165DFF',
        normalRange: '8000-10000'
      }
    },

    tabs: [
      {
        key: 'daily',
        label: '日',
        iconClass: 'fa fa-calendar-o'
      },
      {
        key: 'weekly',
        label: '周',
        iconClass: 'fa fa-calendar'
      },
      {
        key: 'monthly',
        label: '月',
        iconClass: 'fa fa-calendar-check-o'
      }
    ]
  };

  // 根据不同时间段生成不同的数据
  switch (period) {
    case 'weekly':
      return {
        ...baseConfig,
        // 基本信息
        basicInfo: {
          currentDate: '2023年10月第2周',
          avatarUrl: 'https://picsum.photos/id/64/40/40'
        },

        // 健康评分
        healthScore: {
          score: 82,
          text: '良好',
          description: '本周整体健康状况良好，较上周有所改善。血压控制得当，睡眠质量提升明显。'
        },

        // 健康风险
        healthRisks: [
          {
            id: 1,
            riskIcon: 'fa fa-tint',
            riskTitle: '血压波动',
            riskDescription: '本周中期血压有轻微波动，需关注。',
            iconClass: 'risk-icon-warning',
            bgClass: 'risk-bg-warning'
          },
          {
            id: 2,
            riskIcon: 'fa fa-check-circle',
            riskTitle: '睡眠改善',
            riskDescription: '本周平均睡眠时长较上周增加1小时。',
            iconClass: 'risk-icon-success',
            bgClass: 'risk-bg-success'
          },
          {
            id: 3,
            riskIcon: 'fa fa-male',
            riskTitle: '运动量达标',
            riskDescription: '本周有5天步数达标，运动情况良好。',
            iconClass: 'risk-icon-success',
            bgClass: 'risk-bg-success'
          }
        ],

        // 健康建议
        healthSuggestions: [
          {
            id: 1,
            suggestionIcon: 'fa fa-heartbeat',
            suggestionTitle: '持续监测',
            suggestionDescription: '继续保持血压监测，特别是在工作压力较大时。',
            iconClass: 'suggestion-icon-primary'
          },
          {
            id: 2,
            suggestionIcon: 'fa fa-bed',
            suggestionTitle: '保持作息',
            suggestionDescription: '本周睡眠改善明显，建议继续保持规律作息。',
            iconClass: 'suggestion-icon-primary'
          },
          {
            id: 3,
            suggestionIcon: 'fa fa-cutlery',
            suggestionTitle: '饮食均衡',
            suggestionDescription: '继续保持均衡饮食，控制钠盐摄入。',
            iconClass: 'suggestion-icon-primary'
          },
          {
            id: 4,
            suggestionIcon: 'fa fa-line-chart',
            suggestionTitle: '趋势分析',
            suggestionDescription: '下周重点关注心率变化趋势，特别是在运动后。',
            iconClass: 'suggestion-icon-primary'
          }
        ],

        // 健康指标数据
        healthMetrics: {
          heartRate: {
            average: 74,
            status: '正常范围',
            statusClass: 'status-success',
            statusIcon: 'fa fa-check-circle',
            info: '本周心率平均值为74bpm，处于正常范围（60-100bpm）。',
            recommendations: '您的心率处于正常范围，建议保持规律运动，维持健康饮食，避免过度劳累和情绪激动。',
            data: {
              labels: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
              values: [72, 75, 73, 76, 74, 73, 72]
            },
            weeklyStats: {
              max: 76,
              min: 72,
              avg: 74,
              trend: 'stable'
            }
          },
          ecg: {
            average: 0.12,
            status: '正常范围',
            statusClass: 'status-success',
            statusIcon: 'fa fa-check-circle',
            info: '本周心电图平均值为0.12mV，处于正常范围（0.05-0.25mV）。',
            recommendations: '您的心电图数据正常，无明显异常。建议保持规律作息，适量运动，避免过度劳累。',
            data: {
              labels: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
              values: [0.11, 0.13, 0.12, 0.14, 0.12, 0.11, 0.12]
            },
            weeklyStats: {
              max: 0.14,
              min: 0.11,
              avg: 0.12
            }
          },
          bloodPressure: {
            average: '128/82',
            status: '正常范围',
            statusClass: 'status-success',
            statusIcon: 'fa fa-check-circle',
            info: '本周血压平均值为128/82mmHg，处于正常范围。',
            recommendations: '您的血压控制良好，建议继续保持低盐饮食，适量运动，定期监测。',
            data: {
              labels: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
              systolic: [125, 130, 128, 132, 126, 127, 125],
              diastolic: [80, 82, 81, 84, 80, 81, 80]
            },
            weeklyStats: {
              systolic: {
                max: 132,
                min: 125,
                avg: 127.6
              },
              diastolic: {
                max: 84,
                min: 80,
                avg: 81.1
              }
            }
          },
          bloodSugar: {
            average: 5.4,
            status: '正常范围',
            statusClass: 'status-success',
            statusIcon: 'fa fa-check-circle',
            info: '本周血糖平均值为5.4mmol/L，处于正常范围（3.9-6.1mmol/L）。',
            recommendations: '您的血糖指标正常，建议保持均衡饮食，控制碳水化合物摄入，适量运动，定期监测。',
            data: {
              labels: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
              values: [5.2, 5.6, 5.3, 5.5, 5.4, 5.7, 5.1]
            },
            weeklyStats: {
              max: 5.7,
              min: 5.1,
              avg: 5.4
            }
          },
          oxygenLevel: {
            average: 97,
            status: '正常范围',
            statusClass: 'status-success',
            statusIcon: 'fa fa-check-circle',
            info: '本周血氧饱和度平均值为97%，处于正常范围（95-100%）。',
            recommendations: '您的血氧饱和度正常，建议保持室内空气流通，适当进行户外活动。',
            data: {
              labels: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
              values: [97, 96, 98, 97, 97, 98, 96]
            },
            weeklyStats: {
              max: 98,
              min: 96,
              avg: 97
            }
          },
          sleep: {
            average: 7.2,
            status: '良好',
            statusClass: 'status-success',
            statusIcon: 'fa fa-check-circle',
            info: '本周平均睡眠时长为7.2小时，达到推荐标准。',
            recommendations: '您的睡眠质量良好，建议保持规律作息，营造舒适的睡眠环境。',
            data: {
              labels: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
              values: [6.5, 7.0, 7.5, 7.0, 8.0, 7.5, 7.0],
              quality: [80, 85, 90, 85, 95, 90, 85] // 睡眠质量评分
            },
            weeklyStats: {
              max: 8.0,
              min: 6.5,
              avg: 7.2,
              qualityAvg: 87
            }
          },
          steps: {
            average: 8560,
            status: '良好',
            statusClass: 'status-success',
            statusIcon: 'fa fa-check-circle',
            info: '本周平均每日步数为8560步，达到推荐目标。',
            recommendations: '您的活动量良好，建议保持当前运动习惯，可适当增加周末户外活动。',
            data: {
              labels: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
              values: [7842, 8200, 9600, 8300, 9200, 10500, 6280]
            },
            weeklyStats: {
              max: 10500,
              min: 6280,
              avg: 8560,
             达标天数: 5
            }
          }
        }
      };

    case 'monthly':
      return {
        ...baseConfig,
        // 基本信息
        basicInfo: {
          currentDate: '2023年10月',
          avatarUrl: 'https://picsum.photos/id/64/40/40'
        },

        // 健康评分
        healthScore: {
          score: 85,
          text: '优秀',
          description: '本月整体健康状况优秀，各项指标均控制良好。血压、血糖等关键指标持续稳定在正常范围内。'
        },

        // 健康风险
        healthRisks: [
          {
            id: 1,
            riskIcon: 'fa fa-check-circle',
            riskTitle: '整体改善',
            riskDescription: '本月健康状况较上月有明显改善。',
            iconClass: 'risk-icon-success',
            bgClass: 'risk-bg-success'
          },
          {
            id: 2,
            riskIcon: 'fa fa-line-chart',
            riskTitle: '趋势向好',
            riskDescription: '各项健康指标呈现稳定向好趋势。',
            iconClass: 'risk-icon-success',
            bgClass: 'risk-bg-success'
          },
          {
            id: 3,
            riskIcon: 'fa fa-trophy',
            riskTitle: '目标达成',
            riskDescription: '本月步数目标达成率100%，值得鼓励。',
            iconClass: 'risk-icon-success',
            bgClass: 'risk-bg-success'
          }
        ],

        // 健康建议
        healthSuggestions: [
          {
            id: 1,
            suggestionIcon: 'fa fa-heartbeat',
            suggestionTitle: '持续保持',
            suggestionDescription: '继续保持良好的生活习惯，定期体检。',
            iconClass: 'suggestion-icon-primary'
          },
          {
            id: 2,
            suggestionIcon: 'fa fa-bed',
            suggestionTitle: '优化作息',
            suggestionDescription: '可尝试进一步优化睡眠质量，如午休时间控制。',
            iconClass: 'suggestion-icon-primary'
          },
          {
            id: 3,
            suggestionIcon: 'fa fa-calendar-check-o',
            suggestionTitle: '下月目标',
            suggestionDescription: '下月可设定更高运动目标，如每日步数提升至10000步。',
            iconClass: 'suggestion-icon-primary'
          },
          {
            id: 4,
            suggestionIcon: 'fa fa-stethoscope',
            suggestionTitle: '专业咨询',
            suggestionDescription: '建议进行季度健康体检，获取更专业的健康建议。',
            iconClass: 'suggestion-icon-primary'
          }
        ],

        // 月度特殊指标
        monthlyMetrics: {
          // 健康趋势分析
          trendAnalysis: {
            title: '健康趋势分析',
            data: {
              labels: Array.from({length: 30}, (_, i) => `${i + 1}日`),
              heartRate: Array.from({length: 30}, () => Math.floor(Math.random() * 10) + 65),
              bloodPressureSystolic: Array.from({length: 30}, () => Math.floor(Math.random() * 15) + 115),
              sleep: Array.from({length: 30}, () => parseFloat((Math.random() * 3 + 5).toFixed(1))),
              steps: Array.from({length: 30}, () => Math.floor(Math.random() * 5000) + 5000)
            }
          },

          // 健康对比分析
          comparison: {
            title: '月度对比分析',
            data: {
              heartRate: {
                current: 73,
                lastMonth: 76,
                change: -3
              },
              sleep: {
                current: 7.4,
                lastMonth: 6.8,
                change: 0.6
              },
              steps: {
                current: 8920,
                lastMonth: 7850,
                change: 1070
              }
            }
          }
        },

        // 健康指标数据
        healthMetrics: {
          heartRate: {
            average: 73,
            status: '正常范围',
            statusClass: 'status-success',
            statusIcon: 'fa fa-check-circle',
            info: '本月心率平均值为73bpm，处于正常范围（60-100bpm）。',
            recommendations: '您的心率处于正常范围，建议保持规律运动，维持健康饮食，避免过度劳累和情绪激动。',
            data: {
              labels: Array.from({length: 30}, (_, i) => `${i + 1}日`),
              values: Array.from({length: 30}, () => Math.floor(Math.random() * 10) + 65)
            },
            monthlyStats: {
              max: 82,
              min: 65,
              avg: 73,
              stdDev: 3.2 // 标准差
            }
          },
          ecg: {
            average: 0.14,
            status: '正常范围',
            statusClass: 'status-success',
            statusIcon: 'fa fa-check-circle',
            info: '本月心电图平均值为0.14mV，处于正常范围（0.05-0.25mV）。',
            recommendations: '您的心电图数据正常，无明显异常。建议保持规律作息，适量运动，避免过度劳累。',
            data: {
              labels: Array.from({length: 30}, (_, i) => `${i + 1}日`),
              values: Array.from({length: 30}, () => parseFloat((Math.random() * 0.1 + 0.1).toFixed(3)))
            },
            monthlyStats: {
              max: 0.22,
              min: 0.08,
              avg: 0.14
            }
          },
          bloodPressure: {
            average: '126/81',
            status: '正常范围',
            statusClass: 'status-success',
            statusIcon: 'fa fa-check-circle',
            info: '本月血压平均值为126/81mmHg，处于正常范围。',
            recommendations: '您的血压控制良好，建议继续保持低盐饮食，适量运动，定期监测。',
            data: {
              labels: Array.from({length: 30}, (_, i) => `${i + 1}日`),
              systolic: Array.from({length: 30}, () => Math.floor(Math.random() * 15) + 115),
              diastolic: Array.from({length: 30}, () => Math.floor(Math.random() * 10) + 75)
            },
            monthlyStats: {
              systolic: {
                max: 135,
                min: 115,
                avg: 126.2
              },
              diastolic: {
                max: 88,
                min: 75,
                avg: 81.3
              }
            }
          },
          bloodSugar: {
            average: 5.3,
            status: '正常范围',
            statusClass: 'status-success',
            statusIcon: 'fa fa-check-circle',
            info: '本月血糖平均值为5.3mmol/L，处于正常范围（3.9-6.1mmol/L）。',
            recommendations: '您的血糖指标正常，建议保持均衡饮食，控制碳水化合物摄入，适量运动，定期监测。',
            data: {
              labels: Array.from({length: 10}, (_, i) => `${i * 3 + 1}日`),
              values: [5.4, 5.2, 5.3, 5.5, 5.1, 5.6, 5.2, 5.4, 5.3, 5.0]
            },
            monthlyStats: {
              max: 5.6,
              min: 5.0,
              avg: 5.3
            }
          },
          oxygenLevel: {
            average: 97,
            status: '正常范围',
            statusClass: 'status-success',
            statusIcon: 'fa fa-check-circle',
            info: '本月血氧饱和度平均值为97%，处于正常范围（95-100%）。',
            recommendations: '您的血氧饱和度正常，建议保持室内空气流通，适当进行户外活动。',
            data: {
              labels: Array.from({length: 15}, (_, i) => `${i * 2 + 1}日`),
              values: [97, 96, 98, 97, 97, 98, 96, 97, 98, 97, 96, 97, 98, 97, 96]
            },
            monthlyStats: {
              max: 98,
              min: 96,
              avg: 97
            }
          },
          sleep: {
            average: 7.4,
            status: '优秀',
            statusClass: 'status-success',
            statusIcon: 'fa fa-check-circle',
            info: '本月平均睡眠时长为7.4小时，达到推荐标准。',
            recommendations: '您的睡眠质量优秀，建议继续保持规律作息，营造舒适的睡眠环境。',
            data: {
              labels: Array.from({length: 30}, (_, i) => `${i + 1}日`),
              values: Array.from({length: 30}, () => parseFloat((Math.random() * 3 + 5).toFixed(1))),
              quality: Array.from({length: 30}, () => Math.floor(Math.random() * 20) + 80) // 睡眠质量评分
            },
            monthlyStats: {
              max: 9.2,
              min: 5.3,
              avg: 7.4,
              qualityAvg: 89
            }
          },
          steps: {
            average: 8920,
            status: '优秀',
            statusClass: 'status-success',
            statusIcon: 'fa fa-check-circle',
            info: '本月平均每日步数为8920步，达到推荐目标。',
            recommendations: '您的活动量优秀，建议保持当前运动习惯，可适当增加周末户外活动。',
            data: {
              labels: Array.from({length: 30}, (_, i) => `${i + 1}日`),
              values: Array.from({length: 30}, () => Math.floor(Math.random() * 5000) + 5000)
            },
            monthlyStats: {
              max: 12500,
              min: 5200,
              avg: 8920,
              达标天数: 22
            }
          }
        }
      };

    case 'daily':
    default:
      return {
        ...baseConfig,
        // 基本信息
        basicInfo: {
          currentDate: new Date().toLocaleDateString('zh-CN', {
            year: 'numeric',
            month: 'long',
            day: 'numeric'
          }),
          avatarUrl: 'https://picsum.photos/id/64/40/40'
        },

        // 健康评分
        healthScore: {
          score: 78,
          text: '良好',
          description: '您的整体健康状况良好，但存在一些需要注意的指标。通过改善睡眠和控制血压，您的健康评分可以进一步提高。'
        },

        // 健康风险
        healthRisks: [
          {
            id: 1,
            riskIcon: 'fa fa-tint',
            riskTitle: '血压轻度偏高',
            riskDescription: '近一周血压持续略高于正常范围，需关注。',
            iconClass: 'risk-icon-warning',
            bgClass: 'risk-bg-warning'
          },
          {
            id: 2,
            riskIcon: 'fa fa-bed',
            riskTitle: '睡眠不足',
            riskDescription: '连续5天睡眠时长低于推荐的7-8小时。',
            iconClass: 'risk-icon-warning',
            bgClass: 'risk-bg-warning'
          },
          {
            id: 3,
            riskIcon: 'fa fa-check-circle',
            riskTitle: '其他指标正常',
            riskDescription: '心率、血糖、血氧等指标均在正常范围内。',
            iconClass: 'risk-icon-success',
            bgClass: 'risk-bg-success'
          }
        ],

        // 健康建议
        healthSuggestions: [
          {
            id: 1,
            suggestionIcon: 'fa fa-heartbeat',
            suggestionTitle: '控制血压',
            suggestionDescription: '减少盐分摄入，增加有氧运动，保持情绪稳定。',
            iconClass: 'suggestion-icon-primary'
          },
          {
            id: 2,
            suggestionIcon: 'fa fa-bed',
            suggestionTitle: '改善睡眠',
            suggestionDescription: '保持规律作息，睡前1小时避免使用电子设备，营造安静睡眠环境。',
            iconClass: 'suggestion-icon-primary'
          },
          {
            id: 3,
            suggestionIcon: 'fa fa-cutlery',
            suggestionTitle: '饮食建议',
            suggestionDescription: '增加蔬果摄入，减少高脂高糖食物，保持饮食均衡。',
            iconClass: 'suggestion-icon-primary'
          },
          {
            id: 4,
            suggestionIcon: 'fa fa-calendar-check-o',
            suggestionTitle: '定期监测',
            suggestionDescription: '建议未来一周每天监测血压变化，记录睡眠时长。',
            iconClass: 'suggestion-icon-primary'
          }
        ],

        // 健康指标数据
        healthMetrics: {
          heartRate: {
            average: 72,
            status: '正常范围',
            statusClass: 'status-success',
            statusIcon: 'fa fa-check-circle',
            info: '今日心率平均值为72bpm，处于正常范围（60-100bpm）。',
            recommendations: '您的心率处于正常范围，建议保持规律运动，维持健康饮食，避免过度劳累和情绪激动。',
            data: {
              labels: ['00:00', '03:00', '06:00', '09:00', '12:00', '15:00', '18:00', '21:00'],
              values: [65, 62, 68, 75, 73, 70, 73, 72]
            }
          },
          ecg: {
            average: 0.15,
            status: '正常范围',
            statusClass: 'status-success',
            statusIcon: 'fa fa-check-circle',
            info: '今日心电图平均值为0.15mV，处于正常范围（0.05-0.25mV）。',
            recommendations: '您的心电图数据正常，无明显异常。建议保持规律作息，适量运动，避免过度劳累。',
            data: {
              labels: ['00:00', '04:00', '08:00', '12:00', '16:00', '20:00'],
              values: [0.12, 0.14, 0.15, 0.16, 0.14, 0.15]
            }
          },
          bloodPressure: {
            average: '135/85',
            status: '轻度偏高',
            statusClass: 'status-warning',
            statusIcon: 'fa fa-exclamation-circle',
            info: '今日血压平均值为135/85mmHg，略高于正常范围。',
            recommendations: '您的血压轻度偏高，建议减少盐分摄入，增加有氧运动，控制体重，保持良好睡眠，避免精神紧张。',
            data: {
              labels: ['06:00', '09:00', '12:00', '15:00', '18:00', '21:00'],
              systolic: [132, 138, 135, 140, 136, 135],
              diastolic: [82, 86, 84, 88, 85, 85]
            }
          },
          bloodSugar: {
            average: 5.6,
            status: '正常范围',
            statusClass: 'status-success',
            statusIcon: 'fa fa-check-circle',
            info: '今日血糖平均值为5.6mmol/L，处于正常范围（3.9-6.1mmol/L）。',
            recommendations: '您的血糖指标正常，建议保持均衡饮食，控制碳水化合物摄入，适量运动，定期监测。',
            data: {
              labels: ['空腹', '早餐后', '午餐前', '午餐后', '晚餐前', '晚餐后'],
              values: [5.2, 6.8, 5.5, 7.1, 5.7, 6.5]
            }
          },
          oxygenLevel: {
            average: 98,
            status: '正常范围',
            statusClass: 'status-success',
            statusIcon: 'fa fa-check-circle',
            info: '今日血氧饱和度平均值为98%，处于正常范围（95-100%）。',
            recommendations: '您的血氧饱和度正常，建议保持室内空气流通，适当进行户外活动，避免长时间处于密闭环境中。',
            data: {
              labels: ['00:00', '04:00', '08:00', '12:00', '16:00', '20:00'],
              values: [97, 96, 98, 99, 98, 98]
            }
          },
          sleep: {
            average: 6.5,
            status: '不足',
            statusClass: 'status-warning',
            statusIcon: 'fa fa-exclamation-circle',
            info: '今日睡眠时长为6.5小时，低于推荐的7-8小时。深度睡眠比例偏低。',
            recommendations: '您的睡眠时长不足，建议保持规律作息，睡前1小时避免使用电子设备，营造安静舒适的睡眠环境，避免睡前饮用咖啡或浓茶。',
            data: {
              labels: ['22:00', '23:00', '00:00', '01:00', '02:00', '03:00', '04:00', '05:00', '06:00', '07:00'],
              deep: [0, 20, 40, 30, 25, 35, 20, 10, 5, 0],
              light: [0, 30, 20, 30, 40, 25, 30, 20, 10, 0],
              awake: [100, 50, 40, 40, 35, 40, 50, 70, 85, 100]
            }
          },
          steps: {
            average: 7842,
            status: '良好',
            statusClass: 'status-success',
            statusIcon: 'fa fa-check-circle',
            info: '今日共行走7842步，接近推荐的每日8000-10000步目标。',
            recommendations: '您的活动量良好，接近每日目标。建议适当增加步行时间，可以尝试在工作间隙进行短距离步行，保持全天活动的均匀性。',
            data: {
              labels: ['06:00', '08:00', '10:00', '12:00', '14:00', '16:00', '18:00', '20:00', '22:00'],
              values: [350, 1200, 850, 1500, 680, 950, 1800, 422, 100]
            }
          }
        }
      };
  }
};

export default generateMockData;
